﻿using System;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Linq;
using XCore.Timer;

namespace SaaS.Scheduler
{
    class Program
    {
        static void Main(string[] args)
        {
            IEnumerable<Type> services = typeof(Program).Assembly.GetTypes().Where(c => c.IsPublic && !c.IsAbstract && c.BaseType == typeof(SchedulerServiceBase));
            Parallel.ForEach(services, type =>
            {
                Console.WriteLine("开始启动{0}任务", type.Name);
                TimeServiceBase service = (TimeServiceBase)Activator.CreateInstance(type, args);
            });
        }
    }
}
